//
//  BasicModel.m
//  IM_LearningGYDF
//
//  Created by gydf on 16/3/11.
//  Copyright © 2016年 mac. All rights reserved.
//

#import "BasicModel.h"

@implementation BasicModel

- (instancetype)initWithResponse:(id)responseObject{
    if (self=[super init]) {
        if ([responseObject[@"code"] isKindOfClass:[NSNumber class]]) {
            NSNumber *num =responseObject[@"code"] ;
            NSNumberFormatter *numberFormatter = [[NSNumberFormatter alloc] init];
            
            NSString* str = [numberFormatter stringFromNumber:num];
            
            self.code=str?str:@"";
        }else{
            self.code=responseObject[@"code"]?responseObject[@"code"]:@"";
        }
        
        self.msg=responseObject[@"msg"]?responseObject[@"msg"]:@"";
    }
    return self;
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key{
}

- (id)valueForUndefinedKey:(NSString *)key{
    return nil;
}


@end
